<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    {include file="layout:_meta" /}
    <title>编辑用户</title>
</head>
<body>
<article class="cl pd-20">
    <form class="form form-horizontal" id="form-admin">

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">内容：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text"  class="input-text" v-model="model.content" placeholder="请输入内容">
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" v-on:click="doSubmit()" value="提交">
            </div>
        </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
{include file="layout:_footer" /}
<!--/_footer 作为公共模版分离出去-->
<script type="text/javascript">

    var model = {
        covertemp:'',
        model: {

        }
    };

    var store_model = new Vue({
        el: "#form-admin",
        data: model,
        methods: {
            //限制输入特殊字符
            btKeyUp(e) {
                e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~！@#￥%……&*（）——\-+={}|《》？：“”【】、；‘’，。、]/g,"");
            },
            //上传封面
            onechangeImg: function(e) {
                var _this = this;
                var files = e.target.files;
                var image = new Image();
                image.crossOrigin = '';
                image.src = window.URL.createObjectURL(files.item(0));
                image.onload = function(){
                    _this.model.avatarUrl = util.getBase64Image(image);
                    _this.covertemp = image.src;
                    //console.log(_this.model.cover);
                }
            },

            doSubmit: function () {
                var _this = this;
                console.log(store_model.model);
                $.ajax({
                    type: 'post',
                    data: _this.model,
                    url: "{:url('feedbacktag/set')}",
                    cache: false,
                    dataType: 'json',
                    success: function (ret) {
                        if (ret.status == true) {
                            layer.msg(ret.message, function () {
                                parent.location.href="{:url('feedbacktag/index')}"+"?pageno="+{$pageno};
                                layer_close();
                            })
                        } else {
                            layer.msg(ret.message);
                        }
                    }
                });
            }
        }
    });

    util.get("{:url('feedbacktag/set')}", {id:"{$id}"},function (data) {
        if (data) {
            store_model.model = data;
        }
        console.log(data,'返回值');
    });




</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
